<?
    header('Content-type: text/x-bibtex');
    header('Content-Disposition: attachment; filename="irisExport.bib"');    
    if (!isset($_GET['q']))
    {
        die('Error: Invalid bibtex file request.');
    }       
    $q = urldecode($_GET['q']);    
    $found = $bibtex->search($q);    
    $smarty->assign('e', $found[0]);
    $smarty->assign('q', $q);
?>